Consistently avoid module resolution errors when using getSymbolAtLocation#58668
Conversation
| Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option | ||
| : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; | ||
| return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : errorMessage); | ||
| return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : errorMessage, ignoreErrors); |
There was a problem hiding this comment.
This is the core of the fix. It propagates the ignoreErrors and the intention to ignore them is highlighted in the comment here:
https://github.dev/microsoft/TypeScript/blob/af3a61fe4487a92d59f9479aa4249d897b91af14/src/compiler/checker.ts#L1654-L1658
| ], | ||
| }); | ||
|
|
||
| verifyTsc({ |
There was a problem hiding this comment.
those are tests related to the referenced issue
| "referencedMap": { | ||
| "./main.ts": [ | ||
| "./data.d.json.ts" | ||
| ] | ||
| }, |
There was a problem hiding this comment.
This feels like an improvement - even though there is a resolution error here, it still depends on this file so it should be reflected here. IIRC, there are other instances of something like this - when despite a resolution errors requested modules are listed here.
| [96mb.ts[0m:[93m1[0m:[93m8[0m - [91merror[0m[90m TS5097: [0mAn import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled. | ||
|
|
||
| [7m1[0m import "./a.ts"; | ||
| [7m [0m [91m ~~~~~~~~[0m | ||
|
|
||
| [[90mHH:MM:SS AM[0m] Found 1 error. Watching for file changes. |
There was a problem hiding this comment.
I think this error should be reported but currently it was reported here accidentally. It's not consistent with a regular - non-incremental/composite executions. I raised an issue about it here: #58725
fe293a5 to
039a66e
Compare
|
@typescript-bot test it |
|
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
|
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
|
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
|
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
|
This appears to be out of date with main. |
fixes #58600
fixes #58791